<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>v-once</title>
  <script src="../../js/vue.js"></script>
</head>

<body>
  <div id="app">
    <h1 v-once>页面加载完成时间:{{new Date(timer).toLocaleString()}}</h1>
    <h1>当前系统时间:{{new Date(timer).toLocaleString()}}</h1>
  </div>

  <script>
    let vm = new Vue({
      el: "#app",
      data: {
        timer: new Date().getTime()
      }
    })
    console.log(vm)
    setInterval(function() {
      vm.timer = new Date().getTime()
    }, 1000);
  </script>
</body>

</html>